use "$input/yu_ash_ready", clear

* use data after 1965
keep if year >= 1965

eststo clear

*control for party affilication interact wth starting decades
eststo: reghdfe cites_pos_m_log   polar_start if rule_P, absorb(stateyear x_decade_start##c.(x_republican x_democrat) i.statefe#c.x_year_start x_decade_start) cluster(state year)
outreg2 using "$output/tables/tab4",  replace se excel  alpha(0.01, 0.05, 0.1) symbol(**, *, +) addtext(Court-year FE, X, Cohort FE, X, StatexStart-year,X, Starting DecadexParty, X) addstat(Adjusted R-squared,  e(r2_a)) nocons nor2 nonotes


*control for affirm rate
eststo: reghdfe cites_pos_m_log  polar_start  crim_action_affirm_m if rule_P, absorb(stateyear i.statefe#c.x_year_start x_decade_start) cluster(state year)
outreg2 using "$output/tables/tab4", append se excel  alpha(0.01, 0.05, 0.1) symbol(**, *, +) addtext(Court-year FE, X, Cohort FE, X, StatexStart-year,X) addstat(Adjusted R-squared,  e(r2_a)) nocons nor2 nonotes


* election year behavior
eststo: reghdfe cites_pos_m_log   polar_start c.polar_start#c.electupP if rule_P, absorb(stateyear i.statefe#c.x_year_start x_decade_start) cluster(state year)
outreg2 using "$output/tables/tab4",  append excel  alpha(0.01, 0.05, 0.1) symbol(**, *, +) addtext(Court-year FE, X, Cohort FE, X, StatexStart-year,X) addstat(Adjusted R-squared,  e(r2_a)) nocons nor2 nonotes


* compare civil and criminal cases
eststo: reghdfe civ_cites_pos_m_log polar_start  if rule_P, absorb(stateyear##c.(x_republican x_democrat)  statefe##c.(x_year_start) x_decade_start) cluster(state year)
outreg2 using "$output/tables/tab4", append se excel  alpha(0.01, 0.05, 0.1) symbol(**, *, +) addtext(Court-year FE, X, Cohort FE, X, StatexStart-year,X) addstat(Adjusted R-squared,  e(r2_a)) nocons nor2 nonotes


eststo: reghdfe crim_cites_pos_m_log polar_start  if rule_P, absorb(stateyear##c.(x_republican x_democrat)  statefe##c.(x_year_start) x_decade_start) cluster(state year)
outreg2 using "$output/tables/tab4", append se excel  alpha(0.01, 0.05, 0.1) symbol(**, *, +) addtext(Court-year FE, X, Cohort FE, X, StatexStart-year,X) addstat(Adjusted R-squared,  e(r2_a)) nocons nor2 nonotes